﻿using LWH.ByteProtocol;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ByteProtocolCSharpDemo
{
    /// <summary>
    /// 一般用于定义最基本的协议属性组成
    /// </summary>
    class AbstractIndefiniteLengthProtocol : AbstractProtocol
    {
        //帧头
        protected FixedDataProperty mHeaderProperty;
        //文字byte长度
        protected FixLengthProperty mBasicStringLengthProperty;
        //文字byte
        protected IndefiniteLengthProperty mBasicStringProperty;

        public AbstractIndefiniteLengthProtocol(byte[] data = null) : base(data)
        {
            mHeaderProperty = new FixedDataProperty(this, new byte[] { 0x00, 0x00, 0x00, 0x01 });
            mBasicStringLengthProperty = new FixLengthProperty(this, 4);
        }

        #region Getter&Setter
        public FixedDataProperty HeaderProperty
        {
            get
            {
                return mHeaderProperty;
            }
        }

        #endregion
    }
}
